package com.test.demo.service.impl;

import com.test.demo.mapper.AnswerMapper;
import com.test.demo.po.Answer;
import com.test.demo.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Cenoo on 2017/7/3.
 */

@Service
public class AnswerServiceImpl implements AnswerService{

    @Autowired
    AnswerMapper answerMapper;

    @Override
    public List<Answer> getAnswersOfQuestion(int questionId) {
        return answerMapper.selectByQuestion(questionId);
    }

    @Override
    public int addAnswer(Answer answer) throws Exception {
        return answerMapper.insert(answer);
    }


}
